package cn.com.ccxcredit.wallet.config;

import android.os.Environment;
import android.provider.Settings;

import com.facebook.drawee.backends.pipeline.Fresco;

import java.io.File;

import cn.com.ccxcredit.wallet.RequestInstance;
import cn.com.ccxcredit.wallet.app.RApplication;
import huixue.cn.com.library.util.PackageUtils;
import huixue.cn.com.library.util.ToastUtils;



/**
 * Created by gongdongyang on 2018/7/17.
 */

public class SystemConfig {

    private static  SystemConfig systemConfig;

    private SystemConfig(){

    }

    public static SystemConfig getSystemConfig() {
        if(systemConfig == null){
            synchronized (SystemConfig.class){
                if(systemConfig==null){
                    systemConfig = new SystemConfig();
                }
            }
        }
        return systemConfig;
    }

    public void initConfig(){
        ToastUtils.init(RApplication.application);
        RequestInstance._initInstance();
        //创建restore 文件
        initRestoreFile();

    }


    public void initRestoreFile(){
        String filePath = Environment.getExternalStorageDirectory().toString() + "/wallet";
        File file = new File(filePath);
        if (!file.exists()) {
            file.mkdirs();
        }
    }

    public String getRestoreFile(){
        return  Environment.getExternalStorageDirectory().toString() + "/wallet";
    }


}
